import greenfoot.*;  // (World, Actor, GreenfootImage, Greenfoot and MouseInfo)

/**
 * Write a description of class Oxigeno here.
 * 
 * @author (your name) 
 * @version (a version number or a date)
 */
public class Oxigeno extends Puntaje
{
    /**
     * Act - do whatever the Oxigeno wants to do. This method is called whenever
     * the 'Act' or 'Run' button gets pressed in the environment.
     */    
    public Oxigeno(){
        
        this.getImage().scale(150,50);
        escala=150;
        numero=0;
     }
    public void act() 
    {
        // Add your action code here.

        if(numero==100 && escala!=10){
            escala=escala-10;
            this.getImage().scale(escala,50);
           
            if(escala==10){
                escala=10;  
                this.getImage().scale(escala,50);
            }
            numero=0;
        }
        if(escala==10){
             World aux=getWorld();
            ((StickmanWorld)aux).ReduceAumentaEnergia(true);
                           
        }else{ numero++;}
    }
   public void aumenta(){
        if(escala<=140){escala=escala+10;}       
    }

}
